/*
 * @description:
 * @Author: lal
 * @Date: 2019-08-08 10:21:51
 * @LastEditors: lal
 * @LastEditTime: 2020-08-02 17:00:19
 */
import dayjs from "dayjs";

/**
 * Date formatting
 * like 1565253237551 => 2019-08-08 16:33:57
 * @param {number} value 13位时间戳
 * @param {string} fmt 格式化格式
 */
const formatDate = (value = "", fmt = "YYYY-MM-DD") => {
  return value ? dayjs(value).format(fmt) : "";
};

const logTypeDic = ["业务日志", "系统日志", "crash日志"];
const logLevelDic = ["verbose", "debug", "info", "warn", "error"];
const logType = val => {
  return logTypeDic[val];
};
const logLevel = val => {
  return logLevelDic[val];
};
export { formatDate, logType, logLevel };
